import  request from '@/utils/request'

let prefix='/mall/cartItem'
//加入购物车
export const addCart=(data)=>request({
    method:'post',
    url:`${prefix}/addCart`,
    data
})

//数量加一
export const addOne=(id)=>request({
    method:'put',
    url:`${prefix}/addOne/${id}`
})


//数量减一
export const minusOne=(id)=>request({
    method:'put',
    url:`${prefix}/minusOne/${id}`
})

//获取对应用户的购物车信息
export const getCartList=()=>request({
    method:'get',
    url:`${prefix}/list`
})

//删除购物车
export const deleteCart=(ids)=>request({
    method:'delete',
    url:`${prefix}/delete?ids=${ids}`,
})